<template>
	<view class="box">
		<u-navbar title="福利兑换" :fixed="true" :placeholder="true" :safeAreaInsetTop="true" :autoBack="false"
			leftIconColor="#fff" titleStyle="color:#fff" bgColor="#E0DDDA" rightText="兑换记录" @rightClick="right"
			@leftClick="leftClick"></u-navbar>
		
		<view class="tit">
			请输入兑换码
		</view>
		<view class="ipt_wrap">
			<input type="text" value="" />
		</view>
		<view class="rule">
			<rich-text :nodes="rule"></rich-text>
		</view>
		<view class="btn">
			确定
		</view>
	</view>

</template>

<script>
	import {
	
	} from "../../api/wallet.js"
	export default {
		data() {
			return {
				rule:""
			}
		},
		onLoad() {
		
		},
		onShow() {
		

		},
		methods: {
			leftClick() {
				//获取页面栈的长度
				const canNavBack = getCurrentPages()
				console.log(canNavBack.length);
				// 判断是否刷新了浏览器，刷新了浏览器，页面栈只有当前一个
				if (canNavBack.length > 1) {
					uni.navigateBack({
						delta: 1
					})
				} else {
					uni.switchTab({
						url: '/pages/index/index'
					})
				}
			},
			right(){
				uni.navigateTo({
					url:"/pagesMy/blindBox/exchangelist"
				})
			}

		}
	}
</script>

<style lang="scss" scoped>
	@font-face {
		font-family: 'iconfont';
		src: url("~@/iconfont/almm.ttf");
	}

	.box {
		width: 750rpx;
		height: 100vh;
		background-color: #E0DDDA;
	}


	/deep/ .u-navbar__content__right__text {
		color: #FFFFFF;
	}
	.tit{
		width: 600rpx;
		margin: 0 auto;
		font-weight: 400;
		font-size: 28rpx;
		color: #FFFFFF;
		margin-top: 50rpx;
	}
	.ipt_wrap{
		width: 600rpx;
		height: 80rpx;
		background: #B8A185;
		border-radius: 16rpx 16rpx 16rpx 16rpx;
		margin: 0 auto;
		margin-top: 20rpx;
		>input{
			width: 560rpx;
			height: 80rpx;
			background: #B8A185;
			border-radius: 16rpx 16rpx 16rpx 16rpx;
			color: #fff;
			padding-left: 40rpx;
		}
	}
	.rule{
		width: 600rpx;
		margin: 0 auto;
		height: 400rpx;
		margin-top: 20rpx;
	}
	.btn{
		width: 420rpx;
		height: 88rpx;
		background: linear-gradient( 274deg, #0014FF 0%, #8020EF 50%, #FF2CDF 100%);
		border-radius: 520rpx 520rpx 520rpx 520rpx;
		margin: 0 auto;
		margin-top: 50rpx;
		font-weight: 400;
		font-size: 36rpx;
		color: #FFFFFF;
		text-align: center;
		line-height: 88rpx;
	}
</style>